/*
 * @Description: 就是一个编码添加
 */
import axiosBase from "@/api/axios";
export default {
  /**
   * @description: 分页获取列表 *代表必填
   * @param {Object}  *
   */
  queryPageList(params) {
    return axiosBase.post("/v3/40089-process-v2/productionLine/queryPageByCondition", {
      page: params.page,
      size: params.size,
      entity: params.entity
    });
  },
  /**
   * @description: 条件获取列表 *代表必填
   * @param {Object}  *
   */
  queryByConditionList() {
    return axiosBase.post("/v3/40089-process-v2/productionLine/queryByCondition", { "organizationNo": sessionStorage.organizationNo });
  },
  /**
   * @description: 添加数据项
   * @param {Object}  *
   */
  add(params) {
    return axiosBase.post("/v3/40089-process-v2/productionLine/add", { ...params, "organizationNo": sessionStorage.organizationNo });
  },
  /**
   * @description: 批量删除
   * @param {Object}  *
   */
  del(params) {
    return axiosBase.post("/v3/40089-process-v2/productionLine/delListByNo", { ...params, "organizationNo": sessionStorage.organizationNo });
  },
  /**
   * @description: 点击修改
   * @param {Object}  *
   */
  edit(params) {
    return axiosBase.post("/v3/40089-process-v2/productionLine/edit", { ...params, "organizationNo": sessionStorage.organizationNo });
  },
  /**
   * @description: 点击修改
   * @param {Object}  *
   */
  queryDetailByNo(params) {
    return axiosBase.get(`/v3/40089-process-v2/productionLine/queryDetailByNo?no=${params}&organizationNo=${sessionStorage.organizationNo}`);
  },
  /**
 * @description: 工况监测产线查询排序
 * @param {Object}  *
 */
  queryByConditionAndMonitor(params) {
    return axiosBase.post(`/v3/40089-process-v2/productionLine/queryByConditionAndMonitor`, params);
  },
  /**
 * @description: 根据产线查询设备列表
 * @param {Object}  *
 */
  queryByProductLineNo(params) {
    return axiosBase.get(`/v3/40089-process-v2/productionLine/queryByProductLineNo` + (params.productLineNo ? `?productLineNo=${params.productLineNo}` : ''), params);
  },
  getAvgByDataItemIdAndDate(params) {
    return axiosBase.get(`v3/iot/dataItem/getAvgByDataItemIdAndDate?dataItemId=${params.dataItemId}&startDate=${params.startDate}&endDate=${params.endDate}&organizationNo=${sessionStorage.organizationNo}`);
  }
};
